package com.citicpub_cloud.restfull.dao;

import java.util.List;

import org.springframework.stereotype.Service;

import com.citicpub_cloud.restfull.dao.core.TbVideoInfo;
import com.citicpub_cloud.restfull.dao.jdbc.AbstractJdbcDaoSupport;
import com.citicpub_cloud.restfull.dao.mapper.TbVideoInfoMapper;

@Service
public class VideoDaoService extends AbstractJdbcDaoSupport {
	public TbVideoInfo getBaseInfo(Long id) {
		TbVideoInfo obj = null;
		try {
			String sql = "select video_title,videourl,imgurl,video_size from tb_video_info where id=" + id;
			
			List<TbVideoInfo> list = jdbcTemplate.query(sql,new TbVideoInfoMapper());
			if(list.size()>0){
				obj = list.get(0);
			}
		} catch (Exception e) {
			log.error("根据视频读书id查找基本信息出错", e);
		}
		
		return obj;
	}
}
